
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  cin.exceptions(cin.failbit);
  auto f = [](int x) {
    int sum = 0;
    while (x != 0) {
      sum += x % 10;
      x /= 10;
    }
    return sum;
  };
  int n;
  cin >> n;
  vector<int> a(n + 1);
  a[0] = 1;
    for (int i = 1; i <= n; i++)
      for (int j = 0; j < i; j++)
        a[i] += f(a[j]);

 

  cout << a[n] << '\n';
}